
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>清单号</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <script type="text/javascript" src="../script/config.js"></script>
    <style>
    header{ background-color: #f16c3c; line-height: 42px; height: 42px; position: relative;z-index:999;padding-top:22px;}
    header b{ width: 42px; height: 100%; display: inline-block; position: relative; z-index: 1; background: url() no-repeat center; background-size: 70% auto;  }
    header b.ic-back{ background-image: url(../image/back.png);background-size:25px 25px;}
    /*header b.ic-check{ background-image: url(../image/ic-check.png); float: right; }*/
    header .title{ position: absolute; left: 0; bottom: 0; right: 0;  text-align: center; font-size: 18px;color:white;}
    *{
      margin: 0;
      padding: 0;
    }
    body{
      width:100%;
      height:100%;
      background-color:white;
    }

.center{
    width: 100%;
    height: 160px;

}
.center_1{
  width: 15%;
  float: left;
  /* border: 1px solid red; */
  height: 40px;
  margin-top: 10px;
  text-align: right;
}
.center_2{
    width: 84%;
    /*height: 50px;
    float: left;*/
    margin-left: 10%;
    line-height: 40px;
    font-size: 18px;
}
.center_3{
  width: 84%;
  /*height: 50px;
  float: left;*/
  margin-left: 10%;
  /*padding-left:23px;*/
  line-height: 40px;
  font-size: 18px;
}
.center_1 img{
    height: 23px;
}
.center_2 img{
    height: 23px;
    width:23px;
    vertical-align:middle;
}
.center_3 img{
    height: 30px;
}
.center_4{
    width: 84%;
    float: left;
    height: 50px;
    line-height: 50px;
    font-size: 18px;
}
.xian{
    width: 100%;
    height: 1px;
    background: #ECECEC;
}
.left{
    width: 20%;
    float: left;
}
.foot{
    width: 100%;
    overflow: auto;
}
.but{
    width: 100%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #FFCF09;
    position: fixed;
    bottom: 0;
  }
  .foot_1{
    width: 100%;
    height: 60px;
    float: left;
    margin-top: 5px;
    overflow: hidden;
  }
   .foot_2{
    width: 100%;
    height: 200px;
    float: left;
    margin-top: 5px;
    overflow: hidden;
  }
  .foot1{
    width: 70%;
    height: 30px;
    float: left;
    margin-left: 10%;
    font-size: 14px;
  }
  .foot2{
    float:right;
    width: 20%;
    height: 30px;
    margin-top: 10px;
  }
  .foot2 img{
    width: 30px;
    height: 30px;
  }
  .foot3{
    float: left;
    width: 70%;
    height: 30px;
    margin-left: 10%;
    font-size: 14px;
  }
  .s1{
    display: inline-block;
    width: 7px;
  }
  .xian1{
    width: 100%;
    height: 1px;
    background: #ECECEC;
    float: left;
  }
  .box2{
    width: 80%;
    height: 400px;
    position: fixed;
    left: 10%;
    top: 150px;
    background: white;
    z-index: 100;
    border: 1px solid green;
    display: none;
  }
  .qx{
    width: 40%;
    height: 25px;
    float: right;
    text-align:right;
  }
  .qx img{
    width: 25px;
    height: 25px;
  }
  .box3{
    width: 80%;
    float: left;
    margin-left: 10%;
    height: 30px;
    line-height: 30px;
    font-size: 14px;
  }
  .s2{
    display: inline-block;
    width: 7px;
  }
  .s3{
    display: inline-block;
    width: 28px;
  }
  .xx{
    width: 80%;
    float: left;
    margin-left: 10%;
    text-align: center;
    height: 50px;
  }
  .kong{
    display: inline-block;
    width: 16px;
  }
  .con{
    width: 100%;
    overflow: auto;
  }
  .but1{
    width: 50%;
    height: 40px;
    line-height: 40px;
    float: left;
    text-align: center;
  }
  .but2{
    width: 50%;
    height: 40px;
    line-height: 40px;
    float: left;
    text-align: center;
    background: #E4E4E4;
  }
   .centerbox{
          	width: 100%;

          }
          .scheduling_a{
          margin:1.5rem;
        }


        .scheduling_id{
            width:100%;
          color:#f16c3c;
          height:30px;
          font-size:16px;

        }
        .order_id{
        	width:100%;
        	margin-top:5px;
        	height:25px;
          font-size:16px;
        }

        .order_intro{
        	height:100px;
          display:block;
          margin-left:10%;
          margin-right:10px;
          display:none;
        }
        .order_xian{
          height:0;
          width:100%;
          border-top:1px solid #999999;
        }
        .disp{
          display:block;
        }
        .order_goods{
        	float:left;
          line-height:30px;
          font-size:16px;
          margin-top:5px;
        }
        .look_more{
        	float:right;
        	background-color:#f16c3c;
        	border-radius:10px;
        	font-size:16px;
        	line-height:30px;
          color:white;
          margin:5px;
          margin-right:10%;
          width:80px;
          text-align:center;
        }
        .order_goods_z{
        	height:40px;
          margin-left:10%;

        }
        #sure_img_z{
          width:60%;
          margin-left:20%;
        }
        .schedule_sure_company{
          width:60%;
          margin-left:20%;
          text-align:center;
          margin-top: 20px;
        }
.disp{
  display:block;
}
.fake_img{
  padding-left:23px;
}
.sign_or{
  width:100%;
  text-align:right;
}
.sign_img_s{
  height:50px;
  text-align:right;
}
.center_2>*{
  display:inline;
}
.center_3>*{
  display:inline;
}
.inl{
  display:inline;
}
    </style>
</head>
<body>

        <div class="centerbox" id="centerbox">
        <!-- <div class="center"> -->
            <div class="center_3"><span class="fake_img"></span><span>甲<span class="kong"></span>方:<span id="customer_name" class="inl"></span></span></div>
            <div class="center_3"><span class="fake_img"></span><span>乙<span class="kong"></span>方:<span id="customer_phone" class="inl"></span></span></div>
            <div class="center_2"><img src="../image/add_2.png" alt=""/><span>发<span class="kong"></span>站:<span id="sendcity"></span></span></div>
            <div class="center_2"><img src="../image/add_3.png" alt=""/><span>到<span class="kong"></span>站:<span id="acceptcity"></span></span></div>
        <!-- </div> -->
            <div class="center_2"><img src="../image/add_1.png" alt=""/><span>经<span class="kong"></span>停:<span id="jtcity" class="inl"></span></span></div>
            <div class="center_2"><img src="../image/money.png" alt=""/><span>运<span class="kong"></span>费:<span id="acceptcost"></span></span></div>
            <div class="center_2"><img src="../image/bank_card.png" alt=""/><span>支付方式:<span id="paymethod" class="inl"></span></span></div>
            <div class="center_3"><span class="fake_img"></span><span>备<span class="kong"></span>注:<span id="comment" class="inl"></span></span></div>
            <div class="center_3"><span class="fake_img"></span><span>预约到达时间:<span id="accepttime" class="inl"></span></span></div>
            <div class="xian"></div>
          </div>
          <!-- <div class="center_2"><p>地<span class="kong"></span>址:<span id="accept_address"></span></p></div> -->

    <!-- <img src="" id="sure_img_z"/> -->

</body>
<script type="text/javascript" src="../script/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../script/swipe.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<!-- <script type="text/javascript" src="../script/up_check.js"></script> -->
    <script type="text/javascript">
    apiready = function(){
      var agreement_id=api.pageParam.agreement_id;
      // $api.text($api.dom('#scheduling_id_a'),scheduling_id);
      var user = $api.getStorage('user');
      var lorryid=user.lorryid;


        $api.get(url+'app.php/agreement_scheduling_id?agreement_id='+agreement_id,function(ret){
                 if(ret.result==0){
                   api.toast({
                      msg: '成功',
                      duration: 1000,
                     location: 'middle'
                   });
                                 $api.text($api.dom('#customer_name'),ret.agreement.company);
                                 $api.text($api.dom('#customer_phone'),ret.agreement.lorry_name);
                                 $api.text($api.dom('#sendcity'),ret.agreement.name);
                                 $api.text($api.dom('#acceptcity'),ret.agreement.rcity);
                                 if(ret.agreement.receive_tj_citys){
                                   $api.text($api.dom('#jtcity'),ret.agreement.receive_tj_citys);
                                 }

                                 $api.text($api.dom('#acceptcost'),ret.agreement.freight);
                                 $api.text($api.dom('#paymethod'),ret.agreement.pay_method);
                                 $api.text($api.dom('#comment'),ret.agreement.agreement_require);
                                 $api.text($api.dom('#accepttime'),ret.agreement.deadline);
                                //  var jtcity='';
                                 for(var i=0;i<ret.agreement_schedulings.length;i++){
                                  //  jtcity=jtcity+ret.agreement_schedulings[i].receive_city_name+',';
                                   $api.append($api.dom('#centerbox'),
                                  //  '<div class="order_id">'+
                                  //                      '运单号:<span>'+ret.goods[i].order_id+'</span><span class="look_more" id="r'+ret.goods[i].order_id+'" >查看更多</span>'+
                                  //                    '</div>'+
                                  //                    '<div class="order_intro" id="d'+ret.goods[i].order_id+'">'+
                                  //                    '<div class="order_id">'+
                                  //                      '货物名称:<span>'+ret.goods[i].goods_name+'</span>'+
                                  //                    '</div>'+
                                                     '<div class="order_goods_z">'+
                                                     '<div class="order_goods">'+
                                                      '清单号:'+ret.agreement_schedulings[i].scheduling_id+'</div>'+
                                                       '<div class="look_more" id="r'+ret.agreement_schedulings[i].scheduling_id+'">查看更多</div></div>'+
                                                        '<div class="order_intro" id="d'+ret.agreement_schedulings[i].scheduling_id+'">'+
                                                     '<div class="order_id">'+
                                                       '总件数:<span>'+ret.agreement_schedulings[i].count_zon+'</span>'+
                                                     '</div>'+
                                                     '<div class="order_id">'+
                                                       '总体积:<span>'+ret.agreement_schedulings[i].capacity_zon+'</span>'+
                                                     '</div>'+
                                                     '<div class="order_id">'+
                                                       '总重量:<span>'+ret.agreement_schedulings[i].weight_zon+'</span>'+
                                                     '</div>'+
                                                     '<div class="order_xian"></div></div>');

                                                     $api.addEvt($api.dom("#r"+ret.agreement_schedulings[i].scheduling_id), 'click', function(){

                                                      var did=$api.attr(this,'id').substring(1);
                                                      $api.toggleCls($api.dom("#d"+did), 'disp');
                                                      if($api.hasCls($api.dom("#d"+did),'disp')){
                                                        $api.text($api.dom("#r"+did),"收起");
                                                      }else{
                                                        $api.text($api.dom("#r"+did),"查看更多");
                                                      }
                                                      var time=user.time;
                                                      check(lorryid,time);
                                                     });

                                 }

                                  if(ret.agreement.sign_img){
                                    $api.append($api.dom('#centerbox'),'<div class="sign_or"><img src="'+ret.agreement.sign_img+'" class="sign_img_s"/></div>');
                                  }
                                }else{
                                  alert(ret.desc);
                                }
                           },'json');


    }
    var check=function(id,time){
      $api.post(url+'app.php/check',{
            body:{lorryid:id,
                  time:time,}
           },function(ret){
            if(ret.result==4){
              alert(ret.desc);
              api.openWin({
                name: 'index',
                url:  '../index.html',
              });
               setTimeout("api.closeWin({name:'main'})",650);
               $api.rmStorage('password');
               var key = 'user';
               var user = {};
               var aa=$api.getStorage(key);
               user.lorryid=aa.lorryid;
                user.telephone=aa.telephone;
               user.flag= aa.flag
               user.pass= '';
               $api.setStorage(key, user);
               api.alert({
                 title: '提示消息',
                 msg: ret.desc,
                 buttons: ['确定']
               });
             }else{
              //  alert(ret.desc);
             }
           });
    }
    </script>
</html>
